package com.zxj.geekstudy.spring;

import org.aspectj.lang.ProceedingJoinPoint;

public class Aop1 {
    
        //前置通知
        public void begin(){
            System.out.println("    ====>begin aop1... "); //2
        }
        
        //后置通知
        public void finish(){
            System.out.println("    ====>finish aop1... "); //4
        }
        
        //环绕通知
        public void around(ProceedingJoinPoint joinPoint) throws Throwable{
            System.out.println("    ====>around begin aop1:" + joinPoint.toShortString()); //1
            //调用process()方法才会真正的执行实际被代理的方法
            joinPoint.proceed();
            
            System.out.println("    ====>around finish aop1:" + joinPoint.toShortString()); //3
        }
        
}
